#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int path;
    int sum = 0;
    int subsetXORSum(vector<int>& nums) {
        dfs(nums, 0);
        return sum;
    }

    void dfs(vector<int>& nums, int pos)
    {

        sum += path;

        for (int i = pos; i < nums.size(); i++)
        {
            path = path ^ nums[i];
            dfs(nums, i + 1);
            path = path ^ nums[i];

        }
    }
};